public class One {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        double a=in.nextDouble();
        char b=in.next().charAt(0);
        int ret=0;
        if(a<=1){
            ret=20;
        }else{
            ret=20+(int)Math.ceil(a-1);
        }
        if(b=='y')
            ret+=5;
        System.out.println(ret);
    }
}
